package com.baidu.mapapi;

import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.util.ArrayList;

class k
{
  private static Constructor<?> a = null;
  private static final int b = Integer.parseInt(Build.VERSION.SDK);

  private static double a(int paramInt, a parama)
  {
    switch (1.a[parama.ordinal()])
    {
    default:
      return 100.0D;
    case 1:
      double d = Math.log(Math.pow(2.6D, paramInt));
      return 100.0D + d * (2.6D * d);
    case 2:
      return 4.0D * Math.pow(2.0D, paramInt);
    case 3:
    }
    return 100.0D + 65.0D * Math.log(Math.pow(2.6D, paramInt));
  }

  static int a(ArrayList<GeoPoint> paramArrayList1, ArrayList<GeoPoint> paramArrayList2, int paramInt, ArrayList<GeoPoint> paramArrayList3)
  {
    if ((paramArrayList1 == null) || (paramArrayList2 == null) || (paramArrayList3 == null))
      return -1;
    paramArrayList3.clear();
    a(paramArrayList1, paramArrayList2, paramArrayList3, a(18 - paramInt, a.c));
    return 0;
  }

  static int a(ArrayList<GeoPoint> paramArrayList1, ArrayList<GeoPoint> paramArrayList2, ArrayList<GeoPoint> paramArrayList3, double paramDouble)
  {
    int i = 0;
    int j = paramArrayList1.size();
    int m;
    if (j < 2)
      m = -1;
    while (true)
    {
      return m;
      int[] arrayOfInt = new int[j];
      for (int k = 0; k < j; k++)
        arrayOfInt[k] = 1;
      a(paramArrayList2, arrayOfInt, 0, j - 1, paramDouble);
      m = 0;
      while (i < j)
      {
        if (arrayOfInt[i] > 0)
        {
          paramArrayList3.add(paramArrayList1.get(i));
          m++;
        }
        i++;
      }
    }
  }

  static int a(ArrayList<GeoPoint> paramArrayList, int[] paramArrayOfInt, int paramInt1, int paramInt2, double paramDouble)
  {
    if (paramInt2 <= paramInt1 + 1)
      return 0;
    double d = 100.0D * (100.0D * (paramDouble * paramDouble));
    long l1 = -1L;
    int i = paramInt1 + 1;
    int j = 0;
    label37: long l2;
    if (i < paramInt2)
    {
      l2 = a((GeoPoint)paramArrayList.get(i), (GeoPoint)paramArrayList.get(paramInt1), (GeoPoint)paramArrayList.get(paramInt2));
      if (l2 <= l1)
        break label150;
      j = i;
    }
    while (true)
    {
      i++;
      l1 = l2;
      break label37;
      if (l1 >= d)
      {
        a(paramArrayList, paramArrayOfInt, paramInt1, j, paramDouble);
        a(paramArrayList, paramArrayOfInt, j, paramInt2, paramDouble);
        return 0;
      }
      for (int k = paramInt1 + 1; k < paramInt2; k++)
        paramArrayOfInt[k] = 0;
      break;
      label150: l2 = l1;
    }
  }

  static long a(GeoPoint paramGeoPoint1, GeoPoint paramGeoPoint2, GeoPoint paramGeoPoint3)
  {
    long l1 = paramGeoPoint1.getLongitudeE6();
    long l2 = paramGeoPoint1.getLatitudeE6();
    long l3 = paramGeoPoint2.getLongitudeE6();
    long l4 = paramGeoPoint2.getLatitudeE6();
    long l5 = paramGeoPoint3.getLongitudeE6();
    long l6 = paramGeoPoint3.getLatitudeE6();
    long l7 = l3 - l5;
    long l8 = l4 - l6;
    long l9 = l7 * l7 + l8 * l8;
    long l14;
    if (l9 == 0L)
    {
      long l19 = l1 - l3;
      long l20 = l2 - l4;
      l14 = l19 * l19 + l20 * l20;
    }
    long l15;
    do
    {
      return l14;
      double d = ((l4 - l2) * (l4 - l6) - (l3 - l1) * (l5 - l3)) / l9;
      if ((d <= 1.0D) && (d >= 0.0D))
        break;
      long l10 = l1 - l3;
      long l11 = l1 - l5;
      long l12 = l2 - l4;
      long l13 = l2 - l6;
      l14 = l10 * l10 + l12 * l12;
      l15 = l11 * l11 + l13 * l13;
    }
    while (l14 < l15);
    return l15;
    long l16 = l6 - l4;
    long l17 = l3 - l5;
    long l18 = (l4 - l2) * -l17 - l16 * (l3 - l1);
    return ()(l18 / l9 * l18);
  }

  static Drawable a(Context paramContext, String paramString)
  {
    try
    {
      InputStream localInputStream = paramContext.getAssets().open(paramString);
      Bitmap localBitmap = BitmapFactory.decodeStream(localInputStream);
      localInputStream.close();
      if (b < 4)
        return new BitmapDrawable(localBitmap);
      Resources localResources = paramContext.getResources();
      if (a == null)
        a = Class.forName("android.graphics.drawable.BitmapDrawable").getConstructor(new Class[] { Resources.class, Bitmap.class });
      Drawable localDrawable = (Drawable)a.newInstance(new Object[] { localResources, localBitmap });
      return localDrawable;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }

  static Drawable a(Context paramContext, String paramString, float paramFloat)
  {
    try
    {
      InputStream localInputStream = paramContext.getAssets().open(paramString);
      Bitmap localBitmap1 = BitmapFactory.decodeStream(localInputStream);
      localInputStream.close();
      Matrix localMatrix = new Matrix();
      localMatrix.reset();
      localMatrix.setRotate(paramFloat);
      Bitmap localBitmap2 = Bitmap.createBitmap(localBitmap1, 0, 0, localBitmap1.getWidth(), localBitmap1.getHeight(), localMatrix, true);
      if (b < 4)
        return new BitmapDrawable(localBitmap2);
      Resources localResources = paramContext.getResources();
      if (a == null)
        a = Class.forName("android.graphics.drawable.BitmapDrawable").getConstructor(new Class[] { Resources.class, Bitmap.class });
      Drawable localDrawable = (Drawable)a.newInstance(new Object[] { localResources, localBitmap2 });
      return localDrawable;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }

  static boolean a(Point paramPoint1, Point paramPoint2, int paramInt1, int paramInt2)
  {
    if (((paramPoint1.x <= 0) && (paramPoint2.x <= 0)) || ((paramPoint1.x >= paramInt1) && (paramPoint2.x >= paramInt1)));
    while (((paramPoint1.y <= 0) && (paramPoint2.y <= 0)) || ((paramPoint1.y >= paramInt2) && (paramPoint2.y >= paramInt2)))
      return false;
    return true;
  }

  private static enum a
  {
    static
    {
      a[] arrayOfa = new a[3];
      arrayOfa[0] = a;
      arrayOfa[1] = b;
      arrayOfa[2] = c;
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.baidu.mapapi.k
 * JD-Core Version:    0.6.2
 */